﻿@model BBICMS.Model.View.PositionListVM
@{
    ViewBag.Title = "广告位";
    ViewBag.PageTitle = ViewBag.Title + "_广告管理";
    Layout = "~/Areas/bbi_Admin/Views/Shared/_LayoutAdmin.cshtml";
}

@section footer{
    <script>
    $(function () {

        var ViewModel = function () {
            this.positions = ko.observableArray(@Html.Raw(Model.PositionsJSON));
            };
        var vm = new ViewModel();
        ko.applyBindings(vm);
       
        })

        //当前菜单
        $(function () {
            $('.mainmenu>li').eq(3).addClass('nav-open').find('.submenu li').eq(1).children('a').addClass('active');
        });
    </script>
}



<div class="toolbar">
    <a href="#" class="showmenu"><i class="fa fa-bars"></i></a>
    <ol class="breadcrumb">
        <li><a href="@Url.Action("Index","Home")"><i class="glyphicon glyphicon-home"></i> 控制面板</a></li>
        <li><a href="#">广告管理</a></li>
        <li class="active">@ViewBag.Title</li>
    </ol>
</div>
<div class="main-content">

    <div class="box">
        <header class="box-header">
            <h3><i class="glyphicon glyphicon-map-marker"></i> @ViewBag.Title</h3>
            <div class="control">
                <a href="#" class="expand"><i class="fa fa-expand"></i></a>
                <a href="#" class="compress"><i class="fa fa-compress"></i></a>
            </div>
        </header>

        <section class="box-body">

            <div class="box-toolbar text-right">
                <a class="btn btn-primary" href="@Url.Action("CreatePosition")"><i class="glyphicon glyphicon-plus"></i> 添加广告位</a>
            </div>
            <div class="table-responsive">
                <table class="table table-hover box-table">
                    <thead>
                        <tr>
                            <th>
                                <input type="checkbox">
                            </th>
                            <th>
                                排序
                            </th>
                            <th>
                                位置
                            </th>
                            <th>
                                <span class="line"></span>创建日期
                            </th>
                            <th>
                                <span class="line"></span>创建人
                            </th>
                            <th>
                                <span class="line"></span>操作
                            </th>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: positions">
                        <!-- row -->


                        <tr class="first">
                            <td>
                                <input type="checkbox">
                            </td>
                            <td data-bind="text:importance"></td>
                            <td data-bind="text:title"></td>
                            <td data-bind="text:moment(addedDate).format('YYYY-MM-DD')"></td>
                            <td data-bind="text:addedBy"></td>
                            <td class="action">
                                <a data-bind="attr: {href: '/bbi-Admin/Ad/EditPosition/' + positionId}" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i></a>
                                @*@Html.ActionLink("删除", "Delete", new { id = item.PositionId })*@
                            </td>
                        </tr>


                    </tbody>

                </table>
            </div>
        </section>
        <footer class="box-footer">

        </footer>


    </div>
</div>
<!-- end main container -->